<?php
/**
 * Author Yulin
 * Email  dwzhanglong@126.com
 * Date   2017-9-19
 * Func   澳洲三分彩
 */
defined('IN_YuLin') || exit('NO PERMIT!');

//	返回中奖金额	data为订单信息，plays为玩法

function PrizeCount_19($data,$plays)
{
	global $db;
	
	if(!$data || !$data['result'] || !$plays)
	{
		return 0;
	}
	
	//	玩法
	$result = explode(',',$data['result']);
	
	//	前四、后四、前三、中三、后三、前二、后二
	$qiansi = [$result[0],$result[1],$result[2],$result[3]];
	$housi = [$result[1],$result[2],$result[3],$result[4]];
	$qiansan = [$result[0],$result[1],$result[2]];
	$housan = [$result[2],$result[3],$result[4]];
	$zhongsan = [$result[1],$result[2],$result[3]];
	$qianer = [$result[0],$result[1]];
	$houer = [$result[3],$result[4]];
	
	//	五星单式
	if($plays['playid'] == 20952)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$result);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	五星复式
	if($plays['playid'] == 20953)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 5; $i++)
		{
			in_array($result[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 5 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	五星组合	可以中1-5星奖
	if($plays['playid'] == 20954)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = [];	//	第几位数中奖
		for($i = 0; $i < 5; $i++)
		{
			in_array($result[$i],explode(',',$tmp[$i])) && $tmp2[] = $i;
		}
		
		//	1-5个星将奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		//	奖金
		$tmp0 = 0;
		
		//	一星
		in_array(4,$tmp2) && $tmp0 += $t2[0]['maxprize'];
		
		//	二星
		in_array(3,$tmp2) && in_array(4,$tmp2) && $tmp0 += $t2[1]['maxprize'];
		
		//	三星
		in_array(2,$tmp2) && in_array(3,$tmp2) && in_array(4,$tmp2) && $tmp0 += $t2[2]['maxprize'];
		
		//	四星
		in_array(1,$tmp2) && in_array(2,$tmp2) && in_array(3,$tmp2) && in_array(4,$tmp2) && $tmp0 += $t2[3]['maxprize'];
		
		//	五星
		in_array(0,$tmp2) && in_array(1,$tmp2) && in_array(2,$tmp2) && in_array(3,$tmp2) && in_array(4,$tmp2) && $tmp0 += $t2[4]['maxprize'];
		
		return $tmp0 ? $tmp0 * $data['times'] : 0;
	}
	
	//	五星组选120
	if($plays['playid'] == 20959)
	{
		//	由于组合选的时候，不会出现重复数字，所以开奖号不能出现重复
		$tmp = array_unique($result);
		if(count($tmp) < 5)
		{
			return 0;
		}
		
		$tmp = explode('|',$data['rednum']);
		return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[2],$tmp) && in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	五星组选60	二重号出现1次，后三个数都得出现
	if($plays['playid'] == 20960)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($result);
		
		//	二重号必须出现2次
		$tmp3 = 0;	//	二重号出现2次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 2 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后三个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 3)
		{
			return 0;
		}
		
		return $tmp3 * NumGroup($tmp5,3) * $plays['maxprize'] * $data['times'];
	}
	
	//	五星组选30	二重号出现2次，后一个数得出现
	if($plays['playid'] == 20961)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($result);
		
		//	两个二重号都必须出现2次
		$tmp3 = 0;	//	二重号出现2次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 2 && $tmp3++;
		}
		
		if($tmp3 < 2)
		{
			return 0;
		}		
		
		$tmp5 = 0;	//	后1个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 1)
		{
			return 0;
		}
		
		return NumGroup($tmp3,2) * $tmp5 * $plays['maxprize'] * $data['times'];
	}
	
	//	五星组选20	三重号出现1次，后2个数得出现
	if($plays['playid'] == 20962)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($result);
		
		//	三重号都必须出现3次
		$tmp3 = 0;	//	三重号出现3次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 3 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后三个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 2)
		{
			return 0;
		}
		
		return $tmp3 * NumGroup($tmp5,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	五星组选10	三重号出现1次，二重号出现1次
	if($plays['playid'] == 20963)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($result);
		
		//	三重号都必须出现1次
		$tmp3 = 0;	//	三重号出现3次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 3 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后三个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 2 && $tmp5++;
		}
		
		if($tmp5 < 1)
		{
			return 0;
		}
		
		return $tmp3 * $tmp5 * $plays['maxprize'] * $data['times'];
	}
	
	//	五星组选5	四重号出现1次，后1个数得出现
	if($plays['playid'] == 20964)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($result);
		
		//	四重号都必须出现1次
		$tmp3 = 0;	//	四重号出现4次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 4 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后1个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 1)
		{
			return 0;
		}
		
		return $tmp3 * $tmp5 * $plays['maxprize'] * $data['times'];
	}
	
	//	前四单式
	if($plays['playid'] == 23245)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$qiansi);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前四复式
	if($plays['playid'] == 23246)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 4; $i++)
		{
			in_array($result[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 4 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前四组合	可以中1-4星奖
	if($plays['playid'] == 23247)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = [];	//	第几位数中奖
		for($i = 0; $i < 4; $i++)
		{
			in_array($result[$i],explode(',',$tmp[$i])) && $tmp2[] = $i;
		}
		
		//	1-5个星将奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		//	奖金
		$tmp0 = 0;
		
		//	一星
		in_array(3,$tmp2) && $tmp0 += $t2[0]['maxprize'];
		
		//	二星
		in_array(2,$tmp2) && in_array(3,$tmp2) && $tmp0 += $t2[1]['maxprize'];
		
		//	三星
		in_array(1,$tmp2) && in_array(2,$tmp2) && in_array(3,$tmp2) && $tmp0 += $t2[2]['maxprize'];
		
		//	四星
		in_array(0,$tmp2) && in_array(1,$tmp2) && in_array(2,$tmp2) && in_array(3,$tmp2) && $tmp0 += $t2[3]['maxprize'];
		
		return $tmp0 ? $tmp0 * $data['times'] : 0;
	}
	
	//	前四组选24
	if($plays['playid'] == 23251)
	{
		//	由于组合选的时候，不会出现重复数字，所以开奖号不能出现重复
		$tmp = array_unique($qiansi);
		if(count($tmp) < 3)
		{
			return 0;
		}
		
		$tmp = explode('|',$data['rednum']);
		return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[2],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前四组选12	一个二重号，后面2个数得出现
	if($plays['playid'] == 23252)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($qiansi);
		
		//	2重号都必须出现1次
		$tmp3 = 0;	//	2重号出现2次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 2 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后1个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 2)
		{
			return 0;
		}
		
		return $tmp3 * NumGroup($tmp5,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	前四组选6	2个二重号
	if($plays['playid'] == 23253)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($qiansi);
		
		//	2重号都必须出现1次
		$tmp3 = 0;	//	2重号出现2次的个数
		foreach($tmp as $t4)
		{
			$tmp2[$t4] == 2 && $tmp3++;
		}
		
		if($tmp3 < 2)
		{
			return 0;
		}
		
		return NumGroup($tmp3,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	前四组选4	一个三重号，后面1个数得出现
	if($plays['playid'] == 23254)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($qiansi);
		
		//	3重号都必须出现1次
		$tmp3 = 0;	//	3重号出现3次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 3 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后1个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 1)
		{
			return 0;
		}
		
		return $tmp3 * $tmp5 * $plays['maxprize'] * $data['times'];
	}
	
	//	后四单式
	if($plays['playid'] == 1305)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$housi);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后四复式
	if($plays['playid'] == 1306)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 4; $i++)
		{
			in_array($housi[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 4 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后四组合	可以中1-4星奖
	if($plays['playid'] == 20967)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = [];	//	第几位数中奖
		for($i = 0; $i < 4; $i++)
		{
			in_array($housi[$i],explode(',',$tmp[$i])) && $tmp2[] = $i;
		}
		
		//	1-4个星将奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		//	奖金
		$tmp0 = 0;
		
		//	一星
		in_array(3,$tmp2) && $tmp0 += $t2[0]['maxprize'];
		
		//	二星
		in_array(2,$tmp2) && in_array(3,$tmp2) && $tmp0 += $t2[1]['maxprize'];
		
		//	三星
		in_array(1,$tmp2) && in_array(2,$tmp2) && in_array(3,$tmp2) && $tmp0 += $t2[2]['maxprize'];
		
		//	四星
		in_array(0,$tmp2) && in_array(1,$tmp2) && in_array(2,$tmp2) && in_array(3,$tmp2) && $tmp0 += $t2[3]['maxprize'];
		
		return $tmp0 ? $tmp0 * $data['times'] : 0;
	}
	
	//	后四组选24
	if($plays['playid'] == 20971)
	{
		//	由于组合选的时候，不会出现重复数字，所以开奖号不能出现重复
		$tmp = array_unique($housi);
		if(count($tmp) < 3)
		{
			return 0;
		}
		
		$tmp = explode('|',$data['rednum']);
		return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[2],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后四组选12	一个二重号，后面2个数得出现
	if($plays['playid'] == 20972)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($housi);
		
		//	2重号都必须出现1次
		$tmp3 = 0;	//	2重号出现2次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 2 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后1个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 2)
		{
			return 0;
		}
		
		return $tmp3 * NumGroup($tmp5,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	后四组选6	2个二重号
	if($plays['playid'] == 20973)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($housi);
		
		//	2重号都必须出现1次
		$tmp3 = 0;	//	2重号出现2次的个数
		foreach($tmp as $t4)
		{
			$tmp2[$t4] == 2 && $tmp3++;
		}
		
		if($tmp3 < 2)
		{
			return 0;
		}
		
		return NumGroup($tmp3,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	后四组选4	一个三重号，后面1个数得出现
	if($plays['playid'] == 20974)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($housi);
		
		//	3重号都必须出现1次
		$tmp3 = 0;	//	3重号出现3次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 3 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后1个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 1)
		{
			return 0;
		}
		
		return $tmp3 * $tmp5 * $plays['maxprize'] * $data['times'];
	}
	
	//	后三直选单式
	if($plays['playid'] == 20975)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$housan);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后三直选复式
	if($plays['playid'] == 20976)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 3; $i++)
		{
			in_array($housan[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 3 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后三直选和值
	if($plays['playid'] == 20977)
	{
		$tmp = $housan[0] + $housan[1] + $housan[2];
		
		return in_array($tmp,explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后三组三
	if($plays['playid'] == 20978)
	{
		$tmp2 = array_unique($housan);	//	组合中不会出现重复
		
		$tmp3 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$tmp2) && $tmp3++;
		}
		
		if($tmp3 < 2)
		{
			return 0;
		}
		
		return NumGroup($tmp3,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	后三组六
	if($plays['playid'] == 20979)
	{
		$tmp2 = array_unique($housan);	//	组合中不会出现重复
		
		$tmp3 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$tmp2) && $tmp3++;
		}
		
		if($tmp3 < 3)
		{
			return 0;
		}
		
		return NumGroup($tmp3,3) * $plays['maxprize'] * $data['times'];
	}
	
	//	后三混合组选
	if($plays['playid'] == 20980)
	{
		$tmp2 = array_unique($housan);	//	组合中不会出现重复
		
		$tmp8 = 0;	//	所中奖金
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t1)
		{
			$tmp3 = 0;
			
			$tmp4 = explode(',',$t1);
			foreach($tmp4 as $t4)
			{
				in_array($t4,$tmp2) && $tmp3++;
			}
			
			if($tmp3 > 2)	//	组六
			{
				$tmp8 += NumGroup($tmp3,3) * $t2[1]['maxprize'];
			}
			else if($tmp3 > 1)	//	组三
			{
				$tmp8 += $t2[0]['maxprize'];
			}
		}

		return $tmp8 ? $tmp8 * $data['times'] : 0;
	}
	
	//	后三组选和值
	if($plays['playid'] == 20981)
	{
		$tmp = $housan[0] + $housan[1] + $housan[2];
		$tmp2 = explode('|',$data['rednum']);
		
		if(!in_array($tmp,$tmp2))
		{
			return 0;
		}
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		//	有重复值则中组三，否则中组六
		return ((($housan[0] == $housan[1]) || ($housan[0] == $housan[2]) || ($housan[1] == $housan[2])) ? $t2[0]['maxprize'] : $t2[1]['maxprize']) * $data['times'];
	}
	
	//	前三直选单式
	if($plays['playid'] == 20984)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$qiansan);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前三直选复式
	if($plays['playid'] == 20985)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 3; $i++)
		{
			in_array($qiansan[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 3 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前三直选和值
	if($plays['playid'] == 20986)
	{
		$tmp = $qiansan[0] + $qiansan[1] + $qiansan[2];
		
		return in_array($tmp,explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前三组三
	if($plays['playid'] == 20987)
	{
		$tmp2 = array_unique($qiansan);	//	组合中不会出现重复
		
		$tmp3 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$tmp2) && $tmp3++;
		}
		
		if($tmp3 < 2)
		{
			return 0;
		}
		
		return NumGroup($tmp3,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	前三组六
	if($plays['playid'] == 20988)
	{
		$tmp2 = array_unique($qiansan);	//	组合中不会出现重复
		
		$tmp3 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$tmp2) && $tmp3++;
		}
		
		if($tmp3 < 3)
		{
			return 0;
		}
		
		return NumGroup($tmp3,3) * $plays['maxprize'] * $data['times'];
	}
	
	//	前三混合组选
	if($plays['playid'] == 20989)
	{
		$tmp2 = array_unique($qiansan);	//	组合中不会出现重复
		
		$tmp8 = 0;	//	所中奖金
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t1)
		{
			$tmp3 = 0;
			
			$tmp4 = explode(',',$t1);
			foreach($tmp4 as $t4)
			{
				in_array($t4,$tmp2) && $tmp3++;
			}
			
			if($tmp3 > 2)	//	组六
			{
				$tmp8 += NumGroup($tmp3,3) * $t2[1]['maxprize'];
			}
			else if($tmp3 > 1)	//	组三
			{
				$tmp8 += $t2[0]['maxprize'];
			}
		}

		return $tmp8 ? $tmp8 * $data['times'] : 0;
	}
	
	//	前三组选和值
	if($plays['playid'] == 20990)
	{
		$tmp = $qiansan[0] + $qiansan[1] + $qiansan[2];
		$tmp2 = explode('|',$data['rednum']);
		
		if(!in_array($tmp,$tmp2))
		{
			return 0;
		}
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		//	有重复值则中组三，否则中组六
		return ((($qiansan[0] == $qiansan[1]) || ($qiansan[0] == $qiansan[2]) || ($qiansan[1] == $qiansan[2])) ? $t2[0]['maxprize'] : $t2[1]['maxprize']) * $data['times'];
	}
	
	//	中三直选单式
	if($plays['playid'] == 20993)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$zhongsan);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	中三直选复式
	if($plays['playid'] == 20994)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 3; $i++)
		{
			in_array($zhongsan[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 3 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	中三直选和值
	if($plays['playid'] == 20995)
	{
		$tmp = $zhongsan[0] + $zhongsan[1] + $zhongsan[2];
		
		return in_array($tmp,explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	中三组三
	if($plays['playid'] == 20996)
	{
		$tmp2 = array_unique($zhongsan);	//	组合中不会出现重复
		
		$tmp3 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$tmp2) && $tmp3++;
		}
		
		if($tmp3 < 2)
		{
			return 0;
		}
		
		return NumGroup($tmp3,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	中三组六
	if($plays['playid'] == 20997)
	{
		$tmp2 = array_unique($zhongsan);	//	组合中不会出现重复
		
		$tmp3 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$tmp2) && $tmp3++;
		}
		
		if($tmp3 < 3)
		{
			return 0;
		}
		
		return NumGroup($tmp3,3) * $plays['maxprize'] * $data['times'];
	}
	
	//	中三混合组选
	if($plays['playid'] == 20998)
	{
		$tmp2 = array_unique($zhongsan);	//	组合中不会出现重复
		
		$tmp8 = 0;	//	所中奖金
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t1)
		{
			$tmp3 = 0;
			
			$tmp4 = explode(',',$t1);
			foreach($tmp4 as $t4)
			{
				in_array($t4,$tmp2) && $tmp3++;
			}
			
			if($tmp3 > 2)	//	组六
			{
				$tmp8 += NumGroup($tmp3,3) * $t2[1]['maxprize'];
			}
			else if($tmp3 > 1)	//	组三
			{
				$tmp8 += $t2[0]['maxprize'];
			}
		}

		return $tmp8 ? $tmp8 * $data['times'] : 0;
	}
	
	//	中三组选和值
	if($plays['playid'] == 20999)
	{
		$tmp = $zhongsan[0] + $zhongsan[1] + $zhongsan[2];
		$tmp2 = explode('|',$data['rednum']);
		
		if(!in_array($tmp,$tmp2))
		{
			return 0;
		}
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		//	有重复值则中组三，否则中组六
		return ((($zhongsan[0] == $zhongsan[1]) || ($zhongsan[0] == $zhongsan[2]) || ($zhongsan[1] == $zhongsan[2])) ? $t2[0]['maxprize'] : $t2[1]['maxprize']) * $data['times'];
	}
	
	//	后二直选复式
	if($plays['playid'] == 21002)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 2; $i++)
		{
			in_array($houer[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 2 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后二直选单式
	if($plays['playid'] == 21003)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$houer);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前二直选复式
	if($plays['playid'] == 21004)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 2; $i++)
		{
			in_array($qianer[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 2 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前二直选单式
	if($plays['playid'] == 21005)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$qianer);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后二直选和值
	if($plays['playid'] == 21006)
	{
		$tmp = $houer[0] + $houer[1];
		
		return in_array($tmp,explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前二直选和值
	if($plays['playid'] == 21007)
	{
		$tmp = $qianer[0] + $qianer[1];
		
		return in_array($tmp,explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后二组选复式
	if($plays['playid'] == 21008)
	{
		$tmp = explode('|',$data['rednum']);
		
		return in_array($houer[0],$tmp) && in_array($houer[1],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后二组选单式
	if($plays['playid'] == 21009)
	{
		$tmp = explode('|',$data['rednum']);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 = explode(',',$t2);
			
			in_array($houer[0],$t2) && in_array($houer[1],$t2) && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前二组选复式
	if($plays['playid'] == 21010)
	{
		$tmp = explode('|',$data['rednum']);
		
		return in_array($qianer[0],$tmp) && in_array($qianer[1],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前二组选单式
	if($plays['playid'] == 21011)
	{
		$tmp = explode('|',$data['rednum']);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 = explode(',',$t2);
			
			in_array($qianer[0],$t2) && in_array($qianer[1],$t2) && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后二组选和值
	if($plays['playid'] == 21012)
	{
		//	对子不中奖
		if($houer[0] == $houer[1])
		{
			return 0;
		}
		
		$tmp = $houer[0] + $houer[1];
		
		return in_array($tmp,explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前二组选和值
	if($plays['playid'] == 21013)
	{
		//	对子不中奖
		if($qianer[0] == $qianer[1])
		{
			return 0;
		}
		
		$tmp = $qianer[0] + $qianer[1];
		
		return in_array($tmp,explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	定位胆
	if($plays['parentid'] == 1345)
	{
		//	万位、千位、百位、十位、个位
		if($plays['parentid'] == 21014)
		{
			return in_array($result[0],explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['parentid'] == 21015)
		{
			return in_array($result[1],explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['parentid'] == 21016)
		{
			return in_array($result[2],explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['parentid'] == 21017)
		{
			return in_array($result[3],explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['parentid'] == 21018)
		{
			return in_array($result[4],explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	后三一码不定胆
	if($plays['playid'] == 21019)
	{
		$tmp2 = 0;
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$housan) && $tmp2++;
		}
		
		return $tmp2 * $plays['maxprize'] * $data['times'];
	}
	
	//	后三二码不定胆
	if($plays['playid'] == 21020)
	{
		$tmp = array_unique($housan);
		$tmp2 = explode('|',$data['rednum']);
		
		$len = count($tmp);
		if($len == 1)	//	豹子不中
		{
			return 0;
		}
		else if($len == 2)	//	对子
		{
			return in_array($tmp[0],$tmp2) && in_array($tmp[1],$tmp2) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		$tmp3 = 0;
		in_array($tmp[0],$tmp2) && $tmp3++;
		in_array($tmp[1],$tmp2) && $tmp3++;
		in_array($tmp[2],$tmp2) && $tmp3++;
		
		return $tmp3 > 1 ? NumGroup($tmp3,2) * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前三一码不定胆
	if($plays['playid'] == 21021)
	{
		$tmp2 = 0;
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$qiansan) && $tmp2++;
		}
		
		return $tmp2 * $plays['maxprize'] * $data['times'];
	}
	
	//	前三二码不定胆
	if($plays['playid'] == 21022)
	{
		$tmp = array_unique($qiansan);
		$tmp2 = explode('|',$data['rednum']);
		
		$len = count($tmp);
		if($len == 1)	//	豹子不中
		{
			return 0;
		}
		else if($len == 2)	//	对子
		{
			return in_array($tmp[0],$tmp2) && in_array($tmp[1],$tmp2) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		$tmp3 = 0;
		in_array($tmp[0],$tmp2) && $tmp3++;
		in_array($tmp[1],$tmp2) && $tmp3++;
		in_array($tmp[2],$tmp2) && $tmp3++;
		
		return $tmp3 > 1 ? NumGroup($tmp3,2) * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后二大小单双
	if($plays['playid'] == 21023)
	{
		$da = [$houer[0] > 4,$houer[1] > 4];
		$dan = [$houer[0] % 2,$houer[1] % 2];
		
		$tmp3 = [0,0];
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $k2 => $t2)
		{
			$t2 = explode(',',$t2);
			if($da[$k2])
			{
				in_array('大',$t2) && $tmp3[$k2]++;
			}
			else
			{
				in_array('小',$t2) && $tmp3[$k2]++;
			}
			
			if($dan[$k2])
			{
				in_array('单',$t2) && $tmp3[$k2]++;
			}
			else
			{
				in_array('双',$t2) && $tmp3[$k2]++;
			}
		}
		
		return $tmp3[0] * $tmp3[1] * $plays['maxprize'] * $data['times'];
	}
	
	//	前二大小单双
	if($plays['playid'] == 21024)
	{
		$da = [$qianer[0] > 4,$qianer[1] > 4];
		$dan = [$qianer[0] % 2,$qianer[1] % 2];
		
		$tmp3 = [0,0];
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $k2 => $t2)
		{
			$t2 = explode(',',$t2);
			if($da[$k2])
			{
				in_array('大',$t2) && $tmp3[$k2]++;
			}
			else
			{
				in_array('小',$t2) && $tmp3[$k2]++;
			}
			
			if($dan[$k2])
			{
				in_array('单',$t2) && $tmp3[$k2]++;
			}
			else
			{
				in_array('双',$t2) && $tmp3[$k2]++;
			}
		}
		
		return $tmp3[0] * $tmp3[1] * $plays['maxprize'] * $data['times'];
	}
	
	//	一帆风顺
	if($plays['playid'] == 21025)
	{
		$tmp3 = 0;
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$result) && $tmp3++;
		}
		
		return $tmp3 * $plays['maxprize'] * $data['times'];
	}
	
	//	好事成双
	if($plays['playid'] == 21026)
	{
		$tmp3 = array_count_values($result);
		
		$tmp3 = 0;
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			$tmp3[$t2] > 1 && $tmp3++;
		}
		
		return $tmp3 * $plays['maxprize'] * $data['times'];
	}
	
	//	三星报喜
	if($plays['playid'] == 21027)
	{
		$tmp3 = array_count_values($result);
		
		$tmp3 = 0;
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			$tmp3[$t2] > 2 && $tmp3++;
		}
		
		return $tmp3 * $plays['maxprize'] * $data['times'];
	}
	
	//	四季发财
	if($plays['playid'] == 21028)
	{
		$tmp3 = array_count_values($result);
		
		$tmp3 = 0;
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			$tmp3[$t2] > 3 && $tmp3++;
		}
		
		return $tmp3 * $plays['maxprize'] * $data['times'];
	}
	
	//	任选二复式
	if($plays['parentid'] == 1356)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp[0] = explode(',',$tmp[0]);
		$tmp[1] = explode(',',$tmp[1]);
		
		if($plays['playid'] == 21029)	//	万十
		{
			return in_array($result[0],$tmp[0]) && in_array($result[3],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21143)	//	万千
		{
			return in_array($result[0],$tmp[0]) && in_array($result[1],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21144)	//	万个
		{
			return in_array($result[0],$tmp[0]) && in_array($result[4],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21145)	//	万百
		{
			return in_array($result[0],$tmp[0]) && in_array($result[2],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21146)	//	十个
		{
			return in_array($result[3],$tmp[0]) && in_array($result[4],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21147)	//	千十
		{
			return in_array($result[1],$tmp[0]) && in_array($result[3],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21148)	//	千个
		{
			return in_array($result[1],$tmp[0]) && in_array($result[4],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21149)	//	千百
		{
			return in_array($result[1],$tmp[0]) && in_array($result[2],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21150)	//	百十
		{
			return in_array($result[2],$tmp[0]) && in_array($result[3],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21151)	//	百个
		{
			return in_array($result[2],$tmp[0]) && in_array($result[4],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任选二单式
	if($plays['parentid'] == 1357)
	{
		$tmp = explode('_',$data['rednum']);
		
		if($plays['playid'] == 21030)	//	万十
		{
			return in_array($result[0].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21152)	//	万千
		{
			return in_array($result[0].$result[1],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21153)	//	万个
		{
			return in_array($result[0].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21154)	//	万百
		{
			return in_array($result[0].$result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21155)	//	十个
		{
			return in_array($result[3].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21156)	//	千十
		{
			return in_array($result[1].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21157)	//	千个
		{
			return in_array($result[1].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21158)	//	千百
		{
			return in_array($result[1].$result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21159)	//	百十
		{
			return in_array($result[2].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21160)	//	百个
		{
			return in_array($result[2].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任选二和值
	if($plays['parentid'] == 1358)
	{
		$tmp = explode('|',$data['rednum']);
		
		if($plays['playid'] == 21031)	//	万十
		{
			return in_array(($result[0] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21134)	//	万千
		{
			return in_array(($result[0] + $result[1]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21135)	//	万个
		{
			return in_array(($result[0] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21136)	//	万百
		{
			return in_array(($result[0] + $result[2]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21137)	//	十个
		{
			return in_array(($result[3] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21138)	//	千十
		{
			return in_array(($result[1] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21139)	//	千个
		{
			return in_array(($result[1] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21140)	//	千百
		{
			return in_array(($result[1] + $result[2]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21141)	//	百十
		{
			return in_array(($result[2] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21142)	//	百个
		{
			return in_array(($result[2] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任二组选复式
	if($plays['parentid'] == 1359)
	{
		$tmp = explode('|',$data['rednum']);
		
		if($plays['playid'] == 21032)	//	万十
		{
			return in_array($result[0],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21161)	//	万千
		{
			return in_array($result[0],$tmp) && in_array($result[1],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21162)	//	万个
		{
			return in_array($result[0],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21163)	//	万百
		{
			return in_array($result[0],$tmp) && in_array($result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21164)	//	十个
		{
			return in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21165)	//	千十
		{
			return in_array($result[1],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21166)	//	千个
		{
			return in_array($result[1],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21167)	//	千百
		{
			return in_array($result[1],$tmp) && in_array($result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21168)	//	百十
		{
			return in_array($result[2],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21169)	//	百个
		{
			return in_array($result[2],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任选二组选单式
	if($plays['parentid'] == 1360)
	{
		$tmp = explode('_',$data['rednum']);
		
		if($plays['playid'] == 21033)	//	万十
		{
			return in_array($result[0].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21170)	//	万千
		{
			return in_array($result[0].$result[1],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21171)	//	万个
		{
			return in_array($result[0].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21172)	//	万百
		{
			return in_array($result[0].$result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21173)	//	十个
		{
			return in_array($result[3].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21174)	//	千十
		{
			return in_array($result[1].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21175)	//	千个
		{
			return in_array($result[1].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21176)	//	千百
		{
			return in_array($result[1].$result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21177)	//	百十
		{
			return in_array($result[2].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21178)	//	百个
		{
			return in_array($result[2].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任选二组选和值
	if($plays['parentid'] == 1361)
	{
		$tmp = explode('|',$data['rednum']);
		
		if($plays['playid'] == 21034)	//	万十
		{
			return in_array(($result[0] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21179)	//	万千
		{
			return in_array(($result[0] + $result[1]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21180)	//	万个
		{
			return in_array(($result[0] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21181)	//	万百
		{
			return in_array(($result[0] + $result[2]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21182)	//	十个
		{
			return in_array(($result[3] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21183)	//	千十
		{
			return in_array(($result[1] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21184)	//	千个
		{
			return in_array(($result[1] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21185)	//	千百
		{
			return in_array(($result[1] + $result[2]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21186)	//	百十
		{
			return in_array(($result[2] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21187)	//	百个
		{
			return in_array(($result[2] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任选三单式
	if($plays['parentid'] == 1362)
	{
		$tmp = explode('_',$data['rednum']);
		
		if($plays['playid'] == 21035)	//	万十个
		{
			return in_array($result[0].$result[3].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21188)	//	万千十
		{
			return in_array($result[0].$result[1].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21189)	//	万千个
		{
			return in_array($result[0].$result[1].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21190)	//	万千百
		{
			return in_array($result[0].$result[1].$result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21191)	//	万百十
		{
			return in_array($result[0].$result[3].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21192)	//	万百个
		{
			return in_array($result[0].$result[2].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21193)	//	千十个
		{
			return in_array($result[1].$result[3].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21194)	//	千百十
		{
			return in_array($result[1].$result[2].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21195)	//	千百个
		{
			return in_array($result[1].$result[2].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21196)	//	百十个
		{
			return in_array($result[2].$result[3].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任三直选复式
	if($plays['parentid'] == 1363)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp[0] = explode(',',$tmp[0]);
		$tmp[1] = explode(',',$tmp[1]);
		$tmp[2] = explode(',',$tmp[2]);
		
		if($plays['playid'] == 21036)	//	万十个
		{
			return in_array($result[0],$tmp[0]) && in_array($result[3],$tmp[1]) && in_array($result[4],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21197)	//	万千十
		{
			return in_array($result[0],$tmp[0]) && in_array($result[1],$tmp[1]) && in_array($result[3],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21198)	//	万千个
		{
			return in_array($result[0],$tmp[0]) && in_array($result[1],$tmp[1]) && in_array($result[4],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21199)	//	万千百
		{
			return in_array($result[0],$tmp[0]) && in_array($result[1],$tmp[1]) && in_array($result[2],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21200)	//	万百十
		{
			return in_array($result[0],$tmp[0]) && in_array($result[2],$tmp[1]) && in_array($result[3],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21201)	//	万百个
		{
			return in_array($result[0],$tmp[0]) && in_array($result[2],$tmp[1]) && in_array($result[4],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21202)	//	千十个
		{
			return in_array($result[1],$tmp[0]) && in_array($result[3],$tmp[1]) && in_array($result[4],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21203)	//	千百十
		{
			return in_array($result[1],$tmp[0]) && in_array($result[2],$tmp[1]) && in_array($result[3],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21204)	//	千百个
		{
			return in_array($result[1],$tmp[0]) && in_array($result[2],$tmp[1]) && in_array($result[4],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21205)	//	百十个
		{
			return in_array($result[2],$tmp[0]) && in_array($result[3],$tmp[1]) && in_array($result[4],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任三直选和值
	if($plays['parentid'] == 1364)
	{
		$tmp = explode('|',$data['rednum']);
		
		if($plays['playid'] == 21037)	//	万十个
		{
			return in_array(($result[0] + $result[3] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21206)	//	万千十
		{
			return in_array(($result[0] + $result[1] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21207)	//	万千个
		{
			return in_array(($result[0] + $result[1] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21208)	//	万千百
		{
			return in_array(($result[0] + $result[1] + $result[2]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21209)	//	万百十
		{
			return in_array(($result[0] + $result[2] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21210)	//	万百个
		{
			return in_array(($result[0] + $result[2] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21211)	//	千十个
		{
			return in_array(($result[1] + $result[3] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21212)	//	千百十
		{
			return in_array(($result[1] + $result[2] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21213)	//	千百个
		{
			return in_array(($result[1] + $result[2] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21214)	//	百十个
		{
			return in_array(($result[2] + $result[3] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任三组三	投注双注（如2|3代表23和32）
	if($plays['parentid'] == 1365)
	{
		$tmp = explode('|',$data['rednum']);
		
		if($plays['playid'] == 21038)	//	万十个
		{
			return in_array($result[0],$tmp) && in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21215)	//	万千十
		{
			return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21216)	//	万千个
		{
			return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21217)	//	万千百
		{
			return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21218)	//	万百十
		{
			return in_array($result[0],$tmp) && in_array($result[2],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21219)	//	万百个
		{
			return in_array($result[0],$tmp) && in_array($result[2],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21220)	//	千十个
		{
			return in_array($result[1],$tmp) && in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21221)	//	千百十
		{
			return in_array($result[1],$tmp) && in_array($result[2],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21222)	//	千百个
		{
			return in_array($result[1],$tmp) && in_array($result[2],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21223)	//	百十个
		{
			return in_array($result[2],$tmp) && in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任三组六	投注单注
	if($plays['parentid'] == 1366)
	{
		$tmp = explode('|',$data['rednum']);
		
		if($plays['playid'] == 21039)	//	万十个
		{
			return in_array($result[0],$tmp) && in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21224)	//	万千十
		{
			return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21225)	//	万千个
		{
			return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21226)	//	万千百
		{
			return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21227)	//	万百十
		{
			return in_array($result[0],$tmp) && in_array($result[2],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21228)	//	万百个
		{
			return in_array($result[0],$tmp) && in_array($result[2],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21229)	//	千十个
		{
			return in_array($result[1],$tmp) && in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21230)	//	千百十
		{
			return in_array($result[1],$tmp) && in_array($result[2],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21231)	//	千百个
		{
			return in_array($result[1],$tmp) && in_array($result[2],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 21232)	//	百十个
		{
			return in_array($result[2],$tmp) && in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任三混合组选
	if($plays['parentid'] == 1367)
	{
		$tmp2 = [];
		if($plays['playid'] == 21040)	//	万十个
		{
			$tmp2 = [$result[0],$result[3],$result[4]];
		}
		else if($plays['playid'] == 21130)	//	万千十
		{
			$tmp2 = [$result[0],$result[1],$result[3]];
		}
		else if($plays['playid'] == 21132)	//	万千个
		{
			$tmp2 = [$result[0],$result[1],$result[4]];
		}
		else if($plays['playid'] == 21133)	//	万千百
		{
			$tmp2 = [$result[0],$result[1],$result[2]];
		}
		else if($plays['playid'] == 21135)	//	万百十
		{
			$tmp2 = [$result[0],$result[2],$result[3]];
		}
		else if($plays['playid'] == 21137)	//	万百个
		{
			$tmp2 = [$result[0],$result[2],$result[4]];
		}
		else if($plays['playid'] == 21239)	//	千十个
		{
			$tmp2 = [$result[1],$result[3],$result[4]];
		}
		else if($plays['playid'] == 21241)	//	千百十
		{
			$tmp2 = [$result[1],$result[2],$result[3]];
		}
		else if($plays['playid'] == 21243)	//	千百个
		{
			$tmp2 = [$result[1],$result[2],$result[4]];
		}
		else if($plays['playid'] == 21245)	//	百十个
		{
			$tmp2 = [$result[2],$result[3],$result[4]];
		}
		
		$tmp2 = array_unique($tmp2);	//	组合中不会出现重复		
		$tmp8 = 0;	//	所中奖金
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t1)
		{
			$tmp3 = 0;
			
			$tmp4 = explode(',',$t1);
			foreach($tmp4 as $t4)
			{
				in_array($t4,$tmp2) && $tmp3++;
			}
			
			if($tmp3 > 2)	//	组六
			{
				$tmp8 += NumGroup($tmp3,3) * $t2[1]['maxprize'];
			}
			else if($tmp3 > 1)	//	组三
			{
				$tmp8 += $t2[0]['maxprize'];
			}
		}

		return $tmp8 ? $tmp8 * $data['times'] : 0;
	}
	
	//	任三组选和值
	if($plays['parentid'] == 1368)
	{
		$tmp = '';	//	和值
		$tmp3 = 0;	//	是否有对子
		if($plays['playid'] == 21041)	//	万十个
		{
			$tmp = $result[0] + $result[3] + $result[4];
			$tmp3 = ($result[0] == $result[3]) || ($result[0] == $result[4]) || ($result[3] == $result[4]);
		}
		else if($plays['playid'] == 21247)	//	万千十
		{
			$tmp = $result[0] + $result[1] + $result[3];
			$tmp3 = ($result[0] == $result[3]) || ($result[0] == $result[1]) || ($result[3] == $result[1]);
		}
		else if($plays['playid'] == 21249)	//	万千个
		{
			$tmp = $result[0] + $result[1] + $result[4];
			$tmp3 = ($result[0] == $result[1]) || ($result[0] == $result[1]) || ($result[1] == $result[4]);
		}
		else if($plays['playid'] == 21251)	//	万千百
		{
			$tmp = $result[0] + $result[1] + $result[2];
			$tmp3 = ($result[0] == $result[1]) || ($result[0] == $result[2]) || ($result[1] == $result[2]);
		}
		else if($plays['playid'] == 21253)	//	万百十
		{
			$tmp = $result[0] + $result[2] + $result[3];
			$tmp3 = ($result[0] == $result[2]) || ($result[0] == $result[3]) || ($result[2] == $result[3]);
		}
		else if($plays['playid'] == 21255)	//	万百个
		{
			$tmp = $result[0] + $result[2] + $result[4];
			$tmp3 = ($result[0] == $result[2]) || ($result[0] == $result[4]) || ($result[2] == $result[4]);
		}
		else if($plays['playid'] == 21257)	//	千十个
		{
			$tmp = $result[1] + $result[3] + $result[4];
			$tmp3 = ($result[1] == $result[3]) || ($result[1] == $result[3]) || ($result[3] == $result[4]);
		}
		else if($plays['playid'] == 21259)	//	千百十
		{
			$tmp = $result[1] + $result[2] + $result[3];
			$tmp3 = ($result[1] == $result[2]) || ($result[1] == $result[3]) || ($result[2] == $result[3]);
		}
		else if($plays['playid'] == 21261)	//	千百个
		{
			$tmp = $result[1] + $result[2] + $result[4];
			$tmp3 = ($result[1] == $result[2]) || ($result[1] == $result[4]) || ($result[2] == $result[4]);
		}
		else if($plays['playid'] == 21263)	//	百十个
		{
			$tmp = $result[2] + $result[3] + $result[4];
			$tmp3 = ($result[2] == $result[3]) || ($result[2] == $result[4]) || ($result[3] == $result[4]);
		}
		
		$tmp2 = explode('|',$data['rednum']);		
		if(!in_array($tmp,$tmp2))
		{
			return 0;
		}
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		//	有重复值则中组三，否则中组六
		return ($tmp3 ? $t2[0]['maxprize'] : $t2[1]['maxprize']) * $data['times'];
	}
	
	//	任四直选单式
	if($plays['parentid'] == 2537)
	{
		$tmp2 = [];
		if($plays['playid'] == 23255)	//	千百十个
		{
			$tmp2 = [$result[1],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23256)	//	万百十个
		{
			$tmp2 = [$result[0],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23257)	//	万千十个
		{
			$tmp2 = [$result[0],$result[1],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23258)	//	万千百个
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[4]];
		}
		else if($plays['playid'] == 23259)	//	万千百十
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[3]];
		}
		
		if(!$tmp2)
		{
			return 0;
		}
		
		$tmp2 = implode(',',$tmp2);	//	开奖号
		$tmp0 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t)
		{
			$tmp2 == $t && $tmp0++;
		}
		
		return $tmp0 * $plays['maxprize'] * $data['times'];
	}
	
	//	任四直选复式
	if($plays['parentid'] == 2538)
	{
		$tmp2 = [];
		if($plays['playid'] == 23265)	//	千百十个
		{
			$tmp2 = [$result[1],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23266)	//	万百十个
		{
			$tmp2 = [$result[0],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23267)	//	万千十个
		{
			$tmp2 = [$result[0],$result[1],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23268)	//	万千百个
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[4]];
		}
		else if($plays['playid'] == 23269)	//	万千百十
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[3]];
		}
		
		if(!$tmp2)
		{
			return 0;
		}
		
		$tmp0 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 4; $i++)
		{
			in_array($tmp2[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 4 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	任四组选24
	if($plays['parentid'] == 2543)
	{
		$tmp2 = [];
		if($plays['playid'] == 23325)	//	千百十个
		{
			$tmp2 = [$result[1],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23326)	//	万百十个
		{
			$tmp2 = [$result[0],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23327)	//	万千十个
		{
			$tmp2 = [$result[0],$result[1],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23328)	//	万千百个
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[4]];
		}
		else if($plays['playid'] == 23329)	//	万千百十
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[3]];
		}
		
		if(!$tmp2)
		{
			return 0;
		}
		
		$tmp0 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp2 as $t)
		{
			in_array($t2,$tmp) && $tmp0++;
		}
		
		return $tmp0 == 4 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	任四组选12
	if($plays['parentid'] == 2542)
	{
		$tmp2 = [];
		if($plays['playid'] == 23305)	//	千百十个
		{
			$tmp2 = [$result[1],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23306)	//	万百十个
		{
			$tmp2 = [$result[0],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23307)	//	万千十个
		{
			$tmp2 = [$result[0],$result[1],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23308)	//	万千百个
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[4]];
		}
		else if($plays['playid'] == 23309)	//	万千百十
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[3]];
		}
		
		if(!$tmp2)
		{
			return 0;
		}
		
		$tmp4 = array_count_values($tmp2);
		if(count($tmp4) != 3)	//	只能出现两个一样的，余下两个不一样，也就是三个数
		{
			return 0;
		}
		
		$tmp0 = $tmp3 = 0;	//	二重码中奖个数，1码个数
		$tmp = explode('|',$data['rednum']);
		$tmp[0] = explode(',',$tmp[0]);
		$tmp[1] = explode(',',$tmp[1]);
		foreach($tmp[0] as $t)
		{
			$tmp4[$t] == 2 && $tmp0++;
		}
		foreach($tmp[1] as $t)
		{
			$tmp4[$t] == 1 && $tmp3++;
		}
		
		return ($tmp0 > 0) && ($tmp3 > 2) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	任四组选6
	if($plays['parentid'] == 2541)
	{
		$tmp2 = [];
		if($plays['playid'] == 23295)	//	千百十个
		{
			$tmp2 = [$result[1],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23296)	//	万百十个
		{
			$tmp2 = [$result[0],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23297)	//	万千十个
		{
			$tmp2 = [$result[0],$result[1],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23298)	//	万千百个
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[4]];
		}
		else if($plays['playid'] == 23299)	//	万千百十
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[3]];
		}
		
		if(!$tmp2)
		{
			return 0;
		}
		
		$tmp4 = array_count_values($tmp2);
		if(count($tmp4) != 2)	//	只能出现两对，也就是2个数
		{
			return 0;
		}
		
		$tmp0 = 0;	//	二重码中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t)
		{
			$tmp4[$t] == 2 && $tmp0++;
		}
		
		return ($tmp0 > 1) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	任四组选4
	if($plays['parentid'] == 2536)
	{
		$tmp2 = [];
		if($plays['playid'] == 23285)	//	千百十个
		{
			$tmp2 = [$result[1],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23286)	//	万百十个
		{
			$tmp2 = [$result[0],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23287)	//	万千十个
		{
			$tmp2 = [$result[0],$result[1],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23288)	//	万千百个
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[4]];
		}
		else if($plays['playid'] == 23289)	//	万千百十
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[3]];
		}
		
		if(!$tmp2)
		{
			return 0;
		}
		
		$tmp4 = array_count_values($tmp2);
		if(count($tmp4) != 2)	//	只能出现1个三号的，余下1个，也就是2个数
		{
			return 0;
		}
		
		$tmp0 = $tmp3 = 0;	//	三重码中奖个数，1码个数
		$tmp = explode('|',$data['rednum']);
		$tmp[0] = explode(',',$tmp[0]);
		$tmp[1] = explode(',',$tmp[1]);
		foreach($tmp[0] as $t)
		{
			$tmp4[$t] == 3 && $tmp0++;
		}
		foreach($tmp[1] as $t)
		{
			$tmp4[$t] == 1 && $tmp3++;
		}
		
		return ($tmp0 > 0) && ($tmp3 > 0) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	return 0;
}